import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

/* Layout */
import Layout_student from "@/layout/student";
export const student_constantRoutes = [
  {
    path: "/redirect",
    component: Layout_student,
    hidden: true,
    children: [
      {
        path: "/redirect/:path(.*)",
        component: () => import("@/views/redirect"),
      },
    ],
  },
  {
    path: "/404",
    component: () => import("@/views/error/404"),
    hidden: true,
  },
  {
    path: "*",
    redirect: "/index",
  },
  {
    path: "/401",
    component: () => import("@/views/error/401"),
    hidden: true,
  },
  {
    path: "",
    component: Layout_student,
    redirect: "index",
    children: [
      {
        path: "index",
        component: () => import("@/views/newIndex"),
        name: "Index",
        meta: { tab: "/index", title: "首页", icon: "dashboard", affix: true },
      },
      {
        path: "/notice",
        component: () => import("@/views/announcement/announcementManagement/notice"),
        name: "notice",
        meta: { title: "公告" },
      },
    ],
  },
  {
    path: "/course",
    component: Layout_student,
    hidden: true,
    redirect: "noredirect",
    children: [
      {
        path: "",
        component: () => import("@/views/home/courseList"),
        name: "courseList",
        meta: { tab: "/course", title: "课程列表" },
      },
      {
        path: "/taskList",
        component: () => import("@/views/home/taskList"),
        name: "taskList",
        meta: { tab: "/course", title: "任务列表" },
      },
      {
        path: "/scoreInfo",
        component: () => import("@/views/home/scoreInfo"),
        name: "scoreInfo",
        meta: { tab: "/course", title: "成绩详情" },
      },
      {
        path: "/onlineAssessment",
        component: () => import("@/views/home/onlineAssessment"),
        name: "onlineAssessment",
        meta: { tab: "/course", title: "线上考核" },
      },
      {
        path: "/answerExam",
        component: () => import("@/views/home/answerExam"),
        name: "answerExam",
        meta: { tab: "/course", title: "考试" },
      },
      {
        path: "/examDetail",
        component: () => import("@/views/home/examDetail"),
        name: "examDetail",
        meta: { tab: "/course", title: "考核详情" },
      },
      {
        path: "/approvalAnswer",
        component: () => import("@/views/tea_course/approvalAnswer.vue"),
        name: "approvalAnswer",
        meta: { tab: "/exam", title: "考核批改", icon: "" },
      },
    ],
  },
  {
    path: "/selectCourse",
    component: Layout_student,
    hidden: true,
    redirect: "noredirect",
    children: [
      {
        path: "/selectCourseDetail",
        component: () =>
          import("@/views/selectCourse/selectCourseDetail.vue"),
        name: "selectCourseDetail",
        meta: { tab: "/selectCourse", title: "选课详情" },
      },
    ],
  },
  {
    path: "/message",
    component: Layout_student,
    hidden: true,
    redirect: "noredirect",
    children: [
      {
        path: "",
        component: () => import("@/views/messageCenter.vue"),
        name: "messageCenter",
        meta: { tab: "/message", title: "消息中心" },
      },
      {
        path: "/question",
        component: () => import("@/views/question"),
        meta: { tab: "/message", title: "问卷调查" },
      },
    ],
  },

  // /user/profile
  {
    path: "/user",
    component: Layout_student,
    hidden: true,
    redirect: "noredirect",
    children: [
      {
        path: "",
        component: () => import("@/views/system/stu_user/index"),
        name: "userIndex",
        meta: { tab: "/user", title: "个人中心" },
        children: [
          
          {
            path: "",
            component: () => import("@/views/system/stu_user/personalData"),
            name: "personalData",
            meta: { tab: "/user", title: "个人数据" },
          },
          {
            path: "/personalProfile",
            component: () =>
              import("@/views/system/stu_user/profile/index"),
            name: "profile",
            meta: { tab: "/user", title: "个人资料" },
          },
          {
            path: "/wrongSetOfQuestions",
            component: () => import("@/views/system/stu_user/wrongSetOfQuestions"),
            name: "wrongSetOfQuestions",
            meta: { tab: "/user", title: "错题集" },
          },
          {
            path: "studyRecord",
            component: () => import("@/views/system/stu_user/studyRecord"),
            name: "studyRecord",
            meta: { tab: "/user", title: "学习记录" },
          },
          {
            path: "evaluate",
            component: () => import("@/views/system/stu_user/evaluate"),
            name: "evaluate",
            meta: { tab: "/user", title: "评价" },
          }
        ],
      },
      {
        path: "/wrongTopicList",
        component: () => import("@/views/system/stu_user/wrongTopicList"),
        name: "wrongTopicList",
        meta: { title: "错题集" },
      },
      {
        path: "/redoTopicList",
        component: () => import("@/views/system/stu_user/redoTopicList"),
        name: "redoTopicList",
        meta: { title: "重做错题" },
      },
      {
        path: "reset",
        component: () => import("@/views/system/stu_user/profile/reset"),
        name: "reset",
        meta: { title: "修改密码" },
      },
    ],
  },
];
